package com.write.program.socket.message;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2019-11-20
 * Time: 23:28
 */
public class LoginMessage extends Message{
    public static final int SUCCESS_CODE = 0;
    public static final int FAILED_CODE = 1;

    private int code = 0;

    private String userName;
    private String password;
    private int clientServerPort;

    public LoginMessage() {
    }

    public LoginMessage(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public LoginMessage(String userName, String password) {
        this.userName = userName;
        this.password = password;
    }


    @Override
    public int getType() {
        return MessageConst.LOGIN_MESSAGE_TYPE;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public int getClientServerPort() {
        return clientServerPort;
    }

    public void setClientServerPort(int clientServerPort) {
        this.clientServerPort = clientServerPort;
    }
}
